import { Injectable } from '@angular/core';
import { HttpSerProvider } from '../http-ser/http-ser';
import {APP_SERVE_URL} from '../../app/app.config';

/**
 * App接口列表
 */
@Injectable()
export class InterfaceListProvider {

  constructor(private httpser:HttpSerProvider) {
    console.log('Hello InterfaceListProvider Provider');
  }

  /**
   *  接口测试
   * @param   data:{version:1}
   * @returns Promise
   */
  httpTset() {
    //let url = APP_SERVE_URL + "/userLoginRegisterjfsc/selecIntegralApi";
    let url = "http://m.maoyan.com/movie/list.json?type=coming&offset=0&limit=20";
    //let url = APP_SERVE_URL + "/app";
    return this.httpser.get(url, null);
  }


  /**
   *  获取分类列表
   * @param   data:{version:1}
   * @returns Promise
   */
  httpGetNewsList(keyword, pageNum,pageSize) {

    let url = APP_SERVE_URL + "/v1/GetNewsList";
    var dict = {
      "keyword":keyword,
      "page":pageNum,
      "size":pageSize
    }
    return this.httpser.get(url, dict);
  }

  /**
   *  获取详情页
   * @param   data:{version:1}
   * @returns Promise
   */
  httpGetNewsDetails(sid) {

    //http://api.frp.linkfun.top/applet/v1/details?sid=av7098400
    let url = APP_SERVE_URL + "/applet/v1/details";
    var dict = {
      "sid":sid
    }
    return this.httpser.get(url, dict);
  }








}
